package com;

import com.fz.Test.Hello;
import com.fz.Test.user;
import com.fz.entity.StudentInfo;
import org.junit.Test;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created by xiao zeng on 2017/7/3.
 */
public class UserDome {
protected BeanFactory factory;

protected ClassPathXmlApplicationContext ctx;


@Test
public void test(){
    this.ctx = new ClassPathXmlApplicationContext("user-baen.xml");

    user  u = this.ctx.getBean("uok",user.class);
    ctx.close();
}

@Test
public  void show(){
    this.factory = new ClassPathXmlApplicationContext("user-baen.xml");

    Hello h1 = factory.getBean("us",Hello.class);
    h1.show();
}

@Test
public void sh(){
    this.factory = new ClassPathXmlApplicationContext("user-baen.xml");
    StudentInfo h  = factory.getBean("studentInfo",StudentInfo.class);
    h.show();
}
}
